home *** CD-ROM | disk | FTP | other *** search
/ My Neighborhood / My Neighborhood.iso / mac / MacFiles / Vending.Dxr / 00050.ls < prev    next >
Encoding:
Text File  |  1997-11-18  |  949 b   |  44 lines

  1. on mouseDown
  2.   set the visible of sprite 30 to 1
  3.   updateStage()
  4.   wait(10)
  5.   repeat while the stillDown
  6.   end repeat
  7.   set the visible of sprite 30 to 0
  8.   updateStage()
  9. end
  10.  
  11. on mouseUp
  12.   global numnickel, numdime, answer, nickel, nickelCount, dimeCount, loopCounter
  13.   if (answer <> EMPTY) and (answer <> "four") then
  14.     set answer to EMPTY
  15.     puppetSound("buzz")
  16.     updateStage()
  17.     wait(30)
  18.     puppetSound(0)
  19.     getnext()
  20.   end if
  21.   if answer = "four" then
  22.     set answer to EMPTY
  23.     if nickel = 1 then
  24.       set numnickel to numnickel + 1
  25.       delete line nickelCount of field "nickel"
  26.     else
  27.       set numdime to numdime + 1
  28.       delete line dimeCount of field "dime"
  29.     end if
  30.     puppetSound("Bluup.S")
  31.     updateStage()
  32.     repeat while soundBusy(1)
  33.     end repeat
  34.     puppetSound(0)
  35.     set loopCounter to loopCounter + 1
  36.     if loopCounter = 5 then
  37.       go("win")
  38.     end if
  39.   end if
  40.   getnext()
  41.   wait(30)
  42.   go(the frame)
  43. end
  44.